RaidList_CurrentRaiders = {};

function RaidList_Command(arg1)
	RaidList_CurrentRaiders = BuildList();
	DumpList(RaidList_CurrentRaiders);
end

function BuildList()
	local raidlist = {};
	for i = 1, GetNumRaidMembers() do
		local raider = {};
		raider.Name = UnitName("Raid" .. tostring(i));
		raider.Class = UnitClass("Raid" .. tostring(i));
		
		raidlist[i] = raider;
	end
	
	return raidlist;
end

function DumpList(raidlist)
	output = "";
	for k,v in pairs(raidlist) do 
		output = output .. v.Name .. "(" .. v.Class .. "), "
	end

	DEFAULT_CHAT_FRAME:AddMessage(output);
end

SLASH_RAIDLIST1 = "/raidlist";
SLASH_RAIDLIST2 = "/rlist"; -- A shortcut or alias
SlashCmdList["RAIDLIST"] = RaidList_Command;
